<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of wrapper
 *
 * @author laimis
 */
class GalleryEditWrapper {
    public function wraperController(){
        $actionObject = $this->getRequestAction();
        if($actionObject != null){
            switch ($actionObject) {
                case 'edit':
                    include_once BASEURL.'action/gallery/edit/edit.php';
                    new GalleryEdit();
                    break;
                case 'form':
                    include_once BASEURL.'action/gallery/edit/form.php';
                    new GalleryEditFrom();
                    break;
                default:
                    include_once BASEURL.'web/error.php';
                    exit ();
                    break;
            }
        }else{
            include_once BASEURL.'web/error.php';
            exit ();
        }
    }

    public function getRequestAction(){
        $result = '';
        if(isset ($_REQUEST['request']['arg'])){
            if($_REQUEST['request']['arg'] === 'form'){
                $result = 'form';
            }else{
                $result = 'edit';
            }
        }
        return $result;
    }

    public function GalleryEditWrapper(){
        $this->wraperController();
    }
}
?>
